import request from '@/request/request.js';

// 日程安排列表 - 维保端
export const planList = (data) => {
	return request({
		url: '/org/app/sub/plan/app/list',
		method: 'get',
		data: data
	}, false)
}

// 开始排班 - 维保端
export const planDetails = (data) => {
	return request({
		url: `/org/app/sub/plan/${data}`,
		method: 'get',
	})
}

// 工程师列表 - 维保端
export const userList = (data) => {
	return request({
		url: `/org/app/user/list/${data}`,
		method: 'get',
	})
}

// 开始排班 - 维保端
export const planAppoint = (data) => {
	return request({
		url: `/org/app/sub/plan`,
		method: 'put',
		data: data
	})
}

// 待办事项统计
export const getStatistics = () => {
	return request({
		url: `/org/app/homePage/todo/items/statistics`,
		method: 'get',
	}, false)
}

// 获取日程日期标记
export const getDateMarks = (data) => {
	return request({
		url: `/org/app/schedule/manage/getMarks`,
		method: 'get',
		data
	}, false)
}

// 查询下属用户列表
export const getSubordinates = (data) => {
	return request({
		url: `/org/app/user/manage/subordinate`,
		method: 'get',
		data
	})
}

// 获取下属日程列表
export const getDateSchedules = (data) => {
	return request({
		url: `/org/app/schedule/manage/getSchedules`,
		method: 'get',
		data
	}, false)
}

// 获取项目列表
export const getProjectList = (data) => {
	return request({
		url: `/org/app/project/listByLoginUser`,
		method: 'get',
		data
	})
}

// 看板图表占比
export const getOverall = (data) => {
	return request({
		url: `/org/app/homePage/overall`,
		method: 'get',
		data
	})
}

// 看板任务列表
export const getRanking = (data) => {
	return request({
		url: `/org/app/homePage/manage/ranking`,
		method: 'get',
		data
	})
}

// 看板详情
export const getBoardDetails = (data) => {
	return request({
		url: `/org/app/homePage/dataBoardDetails`,
		method: 'get',
		data
	})
}

// 本人考勤标记列表
export const getClockInMarkList = (data) => {
	return request({
		url: `/org/app/clockIn/record/markList`,
		method: 'get',
		data
	}, false)
}

// 下属考勤标记列表
export const getSubInMarkList = (data) => {
	return request({
		url: `/org/app/clockIn/record/sub/markList`,
		method: 'get',
		data
	}, false)
}

// 本人打卡记录
export const getClockInList = (data) => {
	return request({
		url: `/org/app/clockIn/record/list`,
		method: 'get',
		data
	}, false)
}

// 下属打卡记录
export const getSubClockInList = (data) => {
	return request({
		url: `/org/app/clockIn/record/sub/list`,
		method: 'get',
		data
	})
}

// 新增打卡记录
export const addClockInRecord = (data) => {
	return request({
		url: `/org/app/clockIn/record`,
		method: 'post',
		data
	})
}

// 修改打卡记录
export const updateClockInRecord = (data) => {
	return request({
		url: `/org/app/clockIn/record`,
		method: 'put',
		data
	})
}


// 打卡记录详情
export const getClockInfo = (id) => {
	return request({
		url: `/org/app/clockIn/record/${id}`,
		method: 'get',
	})
}